#include <stdio.h>
int main(){
  //1.
  short sa = -1;
  printf("%hd %#hx\n",sa,sa);
  int ia = sa;
  printf("%d %#x\n",ia,ia);
  unsigned short usa = sa;
  printf("%hu %#hx\n",usa,usa);
  unsigned int uia = sa;
  printf("%u %#x\n",uia,uia);
  float fa = sa;
  printf("%f %#x\n",fa,*(unsigned int *)&fa);
  puts("");
  //2.
  int imax = 2147483647;
  printf("%d %#x\n",imax,imax);
  short smax = imax;
  printf("%hd %#hx\n",imax,imax);
  unsigned short usmax = imax;
  printf("%hu %#hx\n",usmax,usmax);
  unsigned int uimax = imax;
  printf("%u %#x\n",uimax,uimax);
  float fmax = imax;
  printf("%f %#x\n",fmax,*(unsigned int *)&fmax);
  puts("");
  //3.
  float ft = 123456.789e5;
  printf("%f %#x\n",ft,*(unsigned int *)&ft);
  double dt = ft;
  printf("%f %#lx\n",dt,*(unsigned long *)&dt);
  //4.
  double du = 123456.789e5;
  printf("%f %#lx\n",du,*(unsigned long *)&du);
  float fu = du;
  printf("%f %#x\n",fu,*(unsigned int *)&fu);
  //5.
  short yt = -1;
  printf("%hd %hx\n",yt,yt);
  printf("%hd %hx\n",yt<<2,yt<<2);
  printf("%hd %hx\n",yt>>2,yt>>2);//算术右移
  unsigned short yu = -1;
  printf("%hu %hx\n",yu,yu);
  printf("%hu %hx\n",yu<<2,yu<<2);
  printf("%hu %hx\n",yu>>2,yu>>2);//逻辑右移
  return 0;
}
